// 鸭子父类
public class Duck {
    protected String color;
    protected double heavy;

    // 构造方法
    public Duck(String color, double heavy) {
        this.color = color;
        this.heavy = heavy;
    }

    // 飞行方法
    public void fly() {
        System.out.println("鸭子正在飞行");
    }

    // 叫声方法
    public void quack() {
        System.out.println("鸭子正在叫");
    }

    // 设置重量方法
    public void setHeavy(double heavy) {
        this.heavy = heavy;
        System.out.println("设置重量为: " + heavy + "kg");
    }

    // 显示信息方法
    public void displayInfo() {
        System.out.println("颜色: " + color + ", 重量: " + heavy + "kg");
    }

    // Getter 和 Setter 方法
    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getHeavy() {
        return heavy;
    }
}